package com.mzj.saas.jobs.bill.service;

import com.mzj.saas.commons.enums.RemainingStatusEnum;
import com.mzj.saas.jobs.bill.entity.HouseRemaining;
import com.mzj.saas.jobs.bill.repository.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UrgePaymentBillService {
    private static Logger log = LoggerFactory.getLogger(UrgePaymentBillService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HouseRepository houseRepository;
    @Autowired
    private RentBillRelationRepository rentBillRelationRepository;
    @Autowired
    private RentBillRepository rentBillRepository;
    @Autowired
    private HouseRemainingRepository houseRemainingRepository;
    @Autowired
    private HouseRemainingRecordRepository houseRemainingRecordRepository;
    @Autowired
    private HouseRemainingRelationRepository houseRemainingRelationRepository;


    public String work() {

        //账户催缴
        //urgePaymentBill();


        return "SUCCESS";
    }

    private void urgePaymentBill() {
        try {
            log.info("账户催缴 start");
            List<HouseRemaining> remainings = houseRemainingRepository.findByStatus(RemainingStatusEnum.DEFAULTING.getValue());
            if (!remainings.isEmpty()){

            }

            log.info("账户催缴 end");
        } catch (Exception e) {
            log.error("账户催缴 " + e.getMessage(), e);
        }










    }
}
